<?php

namespace App\Http\Controllers\Company;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\CompanyModel;

class CompanyController extends Controller
{
    public function info(Request $request){
        $company = CompanyModel::find($request->company_id);
        return self::ok($company);
    }

    public function save(Request $request){
        $company = CompanyModel::find($request->company_id);
        $company->fill($request->only('short_name', 'address', 'contact_user', 'contact_phone', 'logo'));
        $company->save();
        return self::ok($company);
    }
}
